<div id="main">
  <div id="box">

  </div>
  <div>
    <textarea style="width:80%;" id="input"></textarea>
    <button onclick="submit()">提交</button>
  </div>
</div>
<script>
const boxDom = document.getElementById('box')
const inputDom = document.getElementById('input')

const submit = () => {
  boxDom.innerHTML = ''
  const value = inputDom.value
  let data = []
  if (value) {
    data = eval(value)
  }
  
  const col = 10;
  for(let y = 0;y<10;y++) {
    const divDom = document.createElement('div')
    divDom.className = 'box-item'
    for(let x = 0;x<10;x++) {  
      const span = document.createElement('span')
      span.className = 'cell'
      span.innerText = x + ',' + y
      if (data[y*col+x]) {
        span.title = data[y*col+x]
        span.style.backgroundColor = '#ccc'
      }
      divDom.appendChild(span)
    }
    boxDom.appendChild(divDom)
  }
}

submit()

const d = [[0, 1], [1, 1], [1, 0], [2, 0], [3, 0], [4, 0], [5, 0], [6, 0], 0, 0, [0, 2], [1, 2], [1, 1], [2, 1], [3, 1], [4, 1], [5, 1], [6, 1], [7, 1], 0, [1, 2], 0, 0, [3, 1], [4, 1], [5, 1], [6, 1], [7, 1], 0, 0, [0, 2], [1, 2], [1, 3], [2, 3], [3, 3], [4, 3], [5, 3], [6, 3], [7, 3], 0, [0, 3], [1, 3], [2, 3], [3, 3], [4, 3], [5, 3], [6, 3], [7, 3], 0, 0, [0, 4], [1, 4], [2, 4], [3, 4], [4, 4], [5, 4], [6, 4], 0, 0, 0, [0, 5], [1, 5], [2, 5], [3, 5], [4, 5], [5, 5], 0, 0, 0, 0, [0, 6], [1, 6], [2, 6], [3, 6], 0, 0, 0, 0, 0, 0, [0, 7], [1, 7], [2, 7], 0, 0, 0, 0, 0, 0, 0, [0, 8], [1, 8], 0, 0, 0, 0, 0, 0, 0, 0];

const end = [5,5]
let pathX = end[0]
let pathY = end[1]

let startX = 1
let startY = 2

for(let i = 0;i< 20;i++) {
  key = pathY * 10 + pathX
  console.log(pathX,pathY, d[key])
  if (startX === pathX && startY === pathY) {
    break
  }
  pathX = d[key][0]
  pathY = d[key][1]
}

</script>
<style>
  #main {
    width: 800px;
    margin: auto auto;
    text-align: center;
  }
  #box {
    margin-top: 20px;
    margin-bottom: 20px;
  }
  .cell {
    display: inline-block;
    width: 30px;
    height: 30px;
    text-align: center;
    line-height: 30px;
    margin-bottom: 2px;
    margin-right: 2px;
    border:1px solid #999;
  }
</style>